import request from '@/utils/request'
// 素材上传
export function upload(data) {
  return request({
    url: '/admin/wx.material/upload',
    method: 'POST',
    data
  })
}
// 素材计数
export function stats() {
  return request({
    url: '/admin/wx.material/stats',
    method: 'GET'
  })
}
export function fetchList (query) {
  return request({
    url: '/admin/wx.material/index',
    method: 'GET',
    params: query
  })
}
export function fetchOne (id) {
  return request({
    url: '/admin/wx.material/read',
    method: 'GET',
    params: {
      id
    }
  })
}
export function updateOne(data) {
  return request({
    url: '/admin/wx.material/update',
    method: 'PUT',
    data
  })
}
export function createOne(data) {
  return request({
    url: '/admin/wx.material/save',
    method: 'POST',
    data
  })
}
export function deleteOne(id) {
  return request({
    url: '/admin/wx.material/delete',
    method: 'DELETE',
    params: {
      id
    }
  })
}
